package com.zhaojy.poc.frame;

import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import org.springframework.stereotype.Repository;

/**
 * Created by zhaojiuyang1 on 16/3/12.
 */

public class GpioEntity {

    private GpioController gpioController;




    public GpioEntity() {
        this.gpioController = GpioFactory.getInstance();
    }

    public GpioEntity(GpioController gpioController) {
        this.gpioController = gpioController;
    }

    public void close(){
        if(!gpioController.isShutdown()){
            gpioController.shutdown();
        }
    }
    public GpioController getGpioController() {
        return gpioController;
    }

}
